/* 
 * (C) 2013 Daniel Garcia <contacto {at} danigarcia.org>
 * 
 * http://danigarcia.org
 * 
 * This file is part of BlackList.
 * 
 * BlackList is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * BlackList is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with BlackList.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package org.danigarcia.android.blacklist.service;

import org.danigarcia.android.blacklist.database.ConfigManager;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class BootReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		
		ConfigManager.init(context.getApplicationContext());
		if((ConfigManager.getBoolean(ConfigManager.KEY_SERVICE)) &&
				(ConfigManager.getBoolean(ConfigManager.KEY_STATUS)))
		{
			//Toast.makeText(context, "SERVICIO INICIANDOSE", Toast.LENGTH_LONG).show();
			Intent serviceIntent = new Intent(context, BlockingService.class);
			context.startService(serviceIntent);
		}
		//else
		//{
			//Toast.makeText(context, "EL SERVICIO NO SE INICIARA", Toast.LENGTH_LONG).show();
		//}
	}

}
